<?php

/**
 * Message form base class.
 *
 * @package    FinalsClub
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseMessageForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'user_id'            => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'sender_id'          => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => true)),
      'recipient_id'       => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => true)),
      'type'               => new sfWidgetFormInput(),
      'type_id'            => new sfWidgetFormInput(),
      'folder'             => new sfWidgetFormInput(),
      'replied'            => new sfWidgetFormInput(),
      'trashed'            => new sfWidgetFormInput(),
      'seen'               => new sfWidgetFormInput(),
      'subject'            => new sfWidgetFormInput(),
      'body'               => new sfWidgetFormTextarea(),
      'flag'               => new sfWidgetFormInput(),
      'attachment'         => new sfWidgetFormInput(),
      'origin_id'          => new sfWidgetFormInput(),
      'message_history_id' => new sfWidgetFormPropelChoice(array('model' => 'MessageHistory', 'add_empty' => true)),
      'updated_at'         => new sfWidgetFormDateTime(),
      'created_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorPropelChoice(array('model' => 'Message', 'column' => 'id', 'required' => false)),
      'user_id'            => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'sender_id'          => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id', 'required' => false)),
      'recipient_id'       => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id', 'required' => false)),
      'type'               => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'type_id'            => new sfValidatorInteger(array('required' => false)),
      'folder'             => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'replied'            => new sfValidatorInteger(array('required' => false)),
      'trashed'            => new sfValidatorInteger(array('required' => false)),
      'seen'               => new sfValidatorInteger(array('required' => false)),
      'subject'            => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'body'               => new sfValidatorString(array('required' => false)),
      'flag'               => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'attachment'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'origin_id'          => new sfValidatorInteger(array('required' => false)),
      'message_history_id' => new sfValidatorPropelChoice(array('model' => 'MessageHistory', 'column' => 'id', 'required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('message[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Message';
  }


}
